package day07;

import java.util.HashMap;
import java.util.Map;

public class MapPra {
    public static void main(String[] args) {

        Map<Integer, String>  map  = new HashMap<Integer, String>();
        map.put(1,"aaa");
        map.put(2,"bbb");
        map.put(3,"ccc");
        System.out.println(map.get(1));
        map.remove(1);
        System.out.println(map);

//        迭代key
        for (Integer item :map.keySet()){
            System.out.println("key="+item+";"+"value="+map.get(item));
        }
//迭代value

        for (String val: map.values()){
            System.out.println(val);
        }


    }
}
